package com.mk.graphql.resolver;

import com.mk.graphql.entity.Author;
import com.mk.graphql.entity.Friend;
import graphql.kickstart.tools.GraphQLResolver;
import org.springframework.context.annotation.Configuration;

import java.util.Collections;
import java.util.List;

@Configuration
public class FriendResolver implements GraphQLResolver<Author> {
    public List<Friend> friends(Author author) {
        Friend friend = new Friend();
        friend.setAuthorId(author.getId());
        friend.setName("friend");
        return Collections.singletonList(friend);
    }
}
